package com.hcandtx.Bms.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hcandtx.Bms.bean.ShoppingTrolley;
import com.hcandtx.Bms.mapper.ShoppingMapper;
import com.hcandtx.Bms.service.IShoppingService;

@Service("shoppingService")
public class ShoppingServiceImpl implements IShoppingService {

	@Autowired
	private ShoppingMapper shoppingMapper;
	
	@Override
	public int add(ShoppingTrolley shoppingTrolley) {
		// TODO Auto-generated method stub
		return shoppingMapper.add(shoppingTrolley);
	}

	@Override
	public int deleteById(int id) {
		// TODO Auto-generated method stub
		return shoppingMapper.deleteById(id);
	}

	@Override
	public List<ShoppingTrolley> findAll() {
		// TODO Auto-generated method stub
		return shoppingMapper.findAll();
	}

	@Override
	public List<ShoppingTrolley> findById(int UserId) {
		// TODO Auto-generated method stub
		return shoppingMapper.findById(UserId);
	}

	@Override
	public int updateQuantity(int id, int quantity) {
		// TODO Auto-generated method stub
		return shoppingMapper.updateQuantity(id,quantity);
	}

}
